package gisc.gov.vn.dev.xtable;

import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;

public class UserDao {
	private Connection conn;
	  
	  public UserDao(Connection conn) {
//	    super();
	    this.conn = conn;
	  }

	  public void addUser(int id, String name, Date birthday) throws SQLException {
	    PreparedStatement ps = conn.prepareStatement("insert into user (id, name, birthday) values (?,?,?)");
	    try {
	      ps.setInt(1, id);
	      ps.setString(2, name);
	      ps.setDate(3, birthday);
	      ps.executeUpdate();
	    } finally {
	      ps.close();
	    }
	  }
}
